package com.rtf.framework.mq.rocketmq.producer;

import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

import com.rtf.framework.mq.common.CallBack;

public class RocketMqProducerCallBack implements SendCallback {

	private CallBack callBack;

	protected RocketMqProducerCallBack(CallBack callBack) {
		this.callBack = callBack;
	}

	@Override
	public void onSuccess(SendResult sendResult) {

		callBack.onCompletion(sendResult, null);
	}

	@Override
	public void onException(Throwable e) {

		callBack.onCompletion(null, e);
	}

}
